< previous page page_453 next page >

Page 453
8694cbadb9b1ef7075903f6f95fc1db2.gif
 5:         MsgBox CStr(Err.Number) &  -  & _
 6:         Err.Description, vbOKOnly, App.Title
 7:     Case 55 'File already open
 8:         MsgBox CStr(Err.Number) &  -  & _
 9:         Err.Description, vbOKOnly, App.Title
10:     Case 57 'Device I/O error
11:         MsgBox CStr(Err.Number) &  -  & _
12:         Err.Description, vbOKOnly, App.Title
13:     Case 61 'Disk full
14:         MsgBox CStr(Err.Number) &  -  & _
15:         Err.Description, vbOKOnly, App.Title
16:     Case 68 'Device unavailable
17:         MsgBox CStr(Err.Number) &  -  & _
18:         Err.Description, vbOKOnly, App.Title
19:     Case 70 'Permission denied
20:         MsgBox CStr(Err.Number) &  -  & _
21:         Err.Description, vbOKOnly, App.Title
22:     Case 71 'Disk Not ready
23:         MsgBox CStr(Err.Number) &  -  & _
24:         Err.Description, vbOKOnly, App.Title
25:     Case 75 'Path/File access error
26:         MsgBox CStr(Err.Number) &  -  & _
27:         Err.Description, vbOKOnly, App.Title
28:     Case 76 'Path Not found
29:         MsgBox CStr(Err.Number) &  -  & _
30:         Err.Description, vbOKOnly, App.Title
31:     Case Else
32:         MsgBox CStr(Err.Number) &  -  & _
33:         Err.Description, vbOKOnly, App.Title
34: End Select

Note
This error routine will only report what the error was, not correct it. If you want to add code to correct one or more of these errors, you would simply include that code in the case statement for that error. You can then decide if the solution enables you to continue the operation; if it does, you would need to add a
Resume statement as well.

This routine would be added to the cmdCopy_Click event routine along with the On Error statement at the beginning of the routine, as shown in the following code:
Private Sub cmdCopy_Click()
Dim lngFileSize As Long
Dim intLoopCtr As Integer
Dim intBufferCount As Integer
Dim strInByte As String * 256
On Error GoTo FileCopyError

 
< previous page page_453 next page >

If you like this book, buy it!